<?php
namespace App\Http\Forms;

use App\Library\OSS;
use App\Modules\Coupon\Models\Coupon;
use Kris\LaravelFormBuilder\Form;

class UserCouponForm extends Form
{
    public function buildForm()
    {
        $this
            ->add('coupon_id', 'select', [
                'label' => "选择优惠券",
                'rules' => 'required|integer',
                'choices' => $this->getData('coupon'),
            ])
            ->add('user', 'select', [
                'attr' => ['class' => "form-control select2 search-user", 'multiple' => "multiple"],
                'label' => "发放目标",
                'rules' => 'nullable|array',
                'choices' => [],
            ])
            ->add('submit', 'submit', [
                'attr' => ['class' => "form-control btn btn-success"],
                'label' => '保存',
            ]);
    }
}
